﻿using Dxr.Data.Mapping;

namespace Dxr.Data.Oracle
{
    public class OracleClassInfo : ClassInfo
    {
        public OracleClassInfo(string @as, ClassNode classNode)
            : base(@as, classNode)
        {
        }

        protected override string GetTableName(ClassNode classNode, string asName)
        {
            var tableName = "";
            if (string.IsNullOrWhiteSpace(classNode.Schema))
                tableName = string.Format("{0}", classNode.Table);
            else
                tableName = string.Format("{0}.{1}", classNode.Schema, classNode.Table);

            return string.Format("{0} {1}", tableName, asName);
        }
    }
}
